package com.yunyike.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yunyike.mapper.CountryMapper;
import com.yunyike.model.Country;
import com.yunyike.service.ICountryService;

@Service("countryServiceImpl")
public class CountryServiceImpl implements ICountryService{

	private Logger log = LoggerFactory.getLogger(CountryServiceImpl.class);

	@Autowired
	private CountryMapper countryMapper;
	
	/* (non-Javadoc)
	 * @see com.yunyike.service.ICountryService#addCountry(com.yunyike.model.Country)
	 */
	public int addCountry(Country country) {
		
		log.info("----->> add country....");
		
		int result = 0;
		try {
			result = countryMapper.insert(country);
		} catch (Exception e) {
			log.info("add country has errors,message:"+e.getMessage(),e);
		}
		
		log.info("add country end .result:"+result+"<<----");
		
		return result;
	}
	

	
}
